<?php 

class AboutAction extends BaseAction{
	/**
	 * Ceramics
	 */
	function index(){
		$cid=intval($_GET['cid']);  //获取栏目ID
		if($cid==0){$cid=184;}
		$db=M("category");
		//$aboutinfo = M("category")->where($map)->order(array("orderid"=>"asc","id"=>"desc"))->find();
		if($r=$db->where(array("id"=>$cid,"checkinfo"=>0))->find()){
			$aboutinfo=$r;
			if($aboutinfo['seotitle']==''){
				$aboutinfo['seotitle']=$aboutinfo['classname'].'-'.C('cfg_webname');
			}
			if($aboutinfo['keywords']==''){
				$aboutinfo['keywords']=C('cfg_keyword');
			}
			if($aboutinfo['description']==''){
				$aboutinfo['description']=C('cfg_description');
			}
			$db->where(array("id"=>$cid,"checkinfo"=>0))->setInc('hits',1);
		}else{
			showMsg("参数错误");
			exit;
		}
		$map1['pid'] = $aboutinfo['pid'];
		$map1['checkinfo'] =0;
		$aboutcat = M("category")->where($map1)->order(array("orderid"=>"asc","id"=>"desc"))->select();
		
		if($aboutinfo['modelid']==1){//列表性质
			$aboutlist = M("content")->where(array("pid"=>$cid,"checkinfo"=>0))->order(array("orderid"=>"asc","posttime"=>"desc","id"=>"desc"))->select();
			foreach($aboutlist as $key=>$v){
				$data = json_decode($aboutlist[$key]['content_arr'], true);
				$aboutlist[$key]['video'] = $data['video'];
			}
			//print_r($aboutlist);
		}
		$this->assign("aboutcat",$aboutcat);
		$this->assign("aboutinfo",$aboutinfo);
		$this->assign("aboutlist",$aboutlist);
		$this->assign("menucss2","on");
		$this->display();
	} 

	public function info(){
		$r = getCatgory(56);
		$this->assign('res',$r);
		$this->display();
	}

	public function video(){
		$this->display();
	}

	public function size(){
		$this->display();
	}

	public function jzg(){
		$this->display();
	}


	




}
